package com.lqs.dataservice.Controller;

import com.coxautodev.graphql.tools.GraphQLMutationResolver;
import com.coxautodev.graphql.tools.GraphQLQueryResolver;
import com.lqs.dataservice.Service.MaterialService;
import com.lqs.dataservice.Service.MaterialTypeService;
import com.lqs.dataservice.entity.Material;
import com.lqs.dataservice.entity.MaterialType;
import com.nip.db.mongodb.utils.tips.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * ArmyController
 *
 * @author < a href=" ">BBB</ a>
 * @version v1.0.01
 * @date 2019-12-27 14:45
 */
@Component
public class MaterialTypeController implements GraphQLQueryResolver, GraphQLMutationResolver {
  @Autowired
  MaterialTypeService materialTypeService;

  public List<MaterialType> findAllMaterialType() {
    return materialTypeService.findAllMaterialType();
  }

  public MaterialType findMaterialTypeById(String id) {
    return materialTypeService.findMaterialTypeById(id);
  }

  public Response saveMaterialType(MaterialType entity) {
    return materialTypeService.saveMaterialType(entity);
  }

  public Response deleteMaterialTypeById(String id) {
    return materialTypeService.deleteMaterialTypeById(id);

  }


}
